package com.Iconcat.system.mapper;

import com.Iconcat.system.entity.RechargeRecord;
import com.Iconcat.system.entity.WithdrawalRecord;
import com.Iconcat.system.vo.WithdrawalRecordVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zzq
 * @since 2023-12-13
 */
public interface WithdrawalRecordMapper extends BaseMapper<WithdrawalRecord> {
    @Select("SELECT wr.*, cu.user_name AS member_name, cu.phone_number AS phoneNumber " +
            "FROM withdrawal_record wr " +
            "JOIN cat_user cu ON wr.user_id = cu.userid " +
            "${ew.customSqlSegment}")
    IPage<Map<String, Object>> getWithdrawalBillPage(Page<?> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<WithdrawalRecord> ew);

}
